﻿package com.danielsheldon.GamePack.events 
{
	import com.danielsheldon.GamePack.Resource;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	
	/**
	* ...
	* @author Daniel Sheldon
	*/
	public class ResourceEvent extends Event
	{
		static public const NEW_RESOURCE:String = "newResource";
		static public const RESOURCE_DEPOSIT:String = "resourceDeposit";
		static public const RESOURCE_WITHDRAWAL:String = "resourceWithdrawal";
		
		public var resource:Resource;
		public var change:Number = 0;
		public var kind:String;
		
		private var dispatcher:Sprite = new Sprite();
		
		
		public function ResourceEvent(type:String, resource:Resource) 
		{ 
			super(type);
			kind = resource.kind;
			this.resource = resource;			
		}
		
		public override function clone():Event 
		{ 
			return new ResourceEvent(type, resource);
		} 
		
		public override function toString():String 
		{ 
			return formatToString("ResourceEvent", "type", "bubbles", "cancelable", "kind", "change", "eventPhase", "resource"); 
		}		
	}
	
}